Integrand size = 42, antiderivative size = 119 \[ \int \frac {\cos ^2(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=-\frac {(B-2 C) \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d}+\frac {\sqrt {2} (B-C) \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d}+\frac {B \sin (c+d x)}{d \sqrt {a+a \sec (c+d x)}} \]
[Out]
Time = 0.39 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {4157, 4107, 4005, 3859, 209, 3880} \[ \int \frac {\cos ^2(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=-\frac {(B-2 C) \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{\sqrt {a} d}+\frac {\sqrt {2} (B-C) \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a \sec (c+d x)+a}}\right )}{\sqrt {a} d}+\frac {B \sin (c+d x)}{d \sqrt {a \sec (c+d x)+a}} \]
[In]
[Out]
Rule 209
Rule 3859
Rule 3880
Rule 4005
Rule 4107
Rule 4157
Rubi steps \begin{align*} \text {integral}& = \int \frac {\cos (c+d x) (B+C \sec (c+d x))}{\sqrt {a+a \sec (c+d x)}} \, dx \\ & = \frac {B \sin (c+d x)}{d \sqrt {a+a \sec (c+d x)}}+\frac {\int \frac {-\frac {1}{2} a (B-2 C)+\frac {1}{2} a B \sec (c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx}{a} \\ & = \frac {B \sin (c+d x)}{d \sqrt {a+a \sec (c+d x)}}-\frac {(B-2 C) \int \sqrt {a+a \sec (c+d x)} \, dx}{2 a}+(B-C) \int \frac {\sec (c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx \\ & = \frac {B \sin (c+d x)}{d \sqrt {a+a \sec (c+d x)}}+\frac {(B-2 C) \text {Subst}\left (\int \frac {1}{a+x^2} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}-\frac {(2 (B-C)) \text {Subst}\left (\int \frac {1}{2 a+x^2} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d} \\ & = -\frac {(B-2 C) \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d}+\frac {\sqrt {2} (B-C) \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d}+\frac {B \sin (c+d x)}{d \sqrt {a+a \sec (c+d x)}} \\ \end{align*}
Time = 0.32 (sec) , antiderivative size = 115, normalized size of antiderivative = 0.97 \[ \int \frac {\cos ^2(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\frac {\left (-\left ((B-2 C) \text {arctanh}\left (\sqrt {1-\sec (c+d x)}\right )\right )+\sqrt {2} (B-C) \text {arctanh}\left (\frac {\sqrt {1-\sec (c+d x)}}{\sqrt {2}}\right )+B \cos (c+d x) \sqrt {1-\sec (c+d x)}\right ) \tan (c+d x)}{d \sqrt {1-\sec (c+d x)} \sqrt {a (1+\sec (c+d x))}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(316\) vs. \(2(102)=204\).
Time = 1.86 (sec) , antiderivative size = 317, normalized size of antiderivative = 2.66
method | result | size |
default | \(\frac {\sqrt {a \left (1+\sec \left (d x +c \right )\right )}\, \left (B \sqrt {2}\, \ln \left (\sqrt {\cot \left (d x +c \right )^{2}-2 \cot \left (d x +c \right ) \csc \left (d x +c \right )+\csc \left (d x +c \right )^{2}-1}-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}-C \sqrt {2}\, \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \ln \left (\sqrt {\cot \left (d x +c \right )^{2}-2 \cot \left (d x +c \right ) \csc \left (d x +c \right )+\csc \left (d x +c \right )^{2}-1}-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )-B \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {arctanh}\left (\frac {\sin \left (d x +c \right )}{\left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}}\right )+2 C \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {arctanh}\left (\frac {\sin \left (d x +c \right )}{\left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}}\right )-B \cos \left (d x +c \right ) \cot \left (d x +c \right )+B \cot \left (d x +c \right )\right )}{d a}\) | \(317\) |
[In]
[Out]
none
Time = 0.91 (sec) , antiderivative size = 458, normalized size of antiderivative = 3.85 \[ \int \frac {\cos ^2(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\left [\frac {2 \, B \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - \sqrt {2} {\left ({\left (B - C\right )} a \cos \left (d x + c\right ) + {\left (B - C\right )} a\right )} \sqrt {-\frac {1}{a}} \log \left (\frac {2 \, \sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sqrt {-\frac {1}{a}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 3 \, \cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1}\right ) + {\left ({\left (B - 2 \, C\right )} \cos \left (d x + c\right ) + B - 2 \, C\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (d x + c\right )^{2} + 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right ) + 1}\right )}{2 \, {\left (a d \cos \left (d x + c\right ) + a d\right )}}, \frac {B \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left ({\left (B - 2 \, C\right )} \cos \left (d x + c\right ) + B - 2 \, C\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) - \frac {\sqrt {2} {\left ({\left (B - C\right )} a \cos \left (d x + c\right ) + {\left (B - C\right )} a\right )} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right )}{\sqrt {a}}}{a d \cos \left (d x + c\right ) + a d}\right ] \]
[In]
[Out]
\[ \int \frac {\cos ^2(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\int \frac {\left (B + C \sec {\left (c + d x \right )}\right ) \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{\sqrt {a \left (\sec {\left (c + d x \right )} + 1\right )}}\, dx \]
[In]
[Out]
\[ \int \frac {\cos ^2(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\int { \frac {{\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right )\right )} \cos \left (d x + c\right )^{2}}{\sqrt {a \sec \left (d x + c\right ) + a}} \,d x } \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 365 vs. \(2 (102) = 204\).
Time = 1.92 (sec) , antiderivative size = 365, normalized size of antiderivative = 3.07 \[ \int \frac {\cos ^2(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=-\frac {\frac {\sqrt {2} {\left (B - C\right )} \log \left ({\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2}\right )}{\sqrt {-a} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )} + \frac {{\left (B - 2 \, C\right )} \log \left ({\left | {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} - a {\left (2 \, \sqrt {2} + 3\right )} \right |}\right )}{\sqrt {-a} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )} - \frac {{\left (B - 2 \, C\right )} \log \left ({\left | {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} + a {\left (2 \, \sqrt {2} - 3\right )} \right |}\right )}{\sqrt {-a} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )} + \frac {4 \, \sqrt {2} {\left (3 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} B \sqrt {-a} - B \sqrt {-a} a\right )}}{{\left ({\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} - 6 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} a + a^{2}\right )} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )}}{2 \, d} \]
[In]
[Out]
Timed out. \[ \int \frac {\cos ^2(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\int \frac {{\cos \left (c+d\,x\right )}^2\,\left (\frac {B}{\cos \left (c+d\,x\right )}+\frac {C}{{\cos \left (c+d\,x\right )}^2}\right )}{\sqrt {a+\frac {a}{\cos \left (c+d\,x\right )}}} \,d x \]
[In]
[Out]